package com.yanqu.road.server.cmd.group;

import com.yanqu.road.pb.cross.group.CrossGroupProto;
import com.yanqu.road.pb.worldmessage.WorldMessageProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.group.SystemGroupChatMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_SYSTEM_GROUP_CHAT, desc = "系统跨服分组聊天")
public class SystemCrossGroupChatCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossGroupProto.SystemCrossGroupChatReqMsg reqMsg = CrossGroupProto.SystemCrossGroupChatReqMsg.parseFrom(packet.getBytes());
        int groupId = reqMsg.getGroupId();
        int systemId = reqMsg.getSystemId();
        WorldMessageProto.WorldMessageTempMsg chatMsg = reqMsg.getMsg();
        SystemGroupChatMgr.groupChat(systemId, groupId, chatMsg);
    }

    @Override
    public void sendData() {

    }
}
